{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "16a0c1d8-9aa7-4ceb-9464-48cf4d5738f3",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl\n",
    "from perspective.widget import PerspectiveWidget"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "95d698bb-e72f-407c-bcd5-a025e704bd42",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = pl.read_parquet(\"new_share.parquet\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a228cce4-04b3-4719-9c38-747f968c7833",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "39867464-4291-45d8-9806-2440e9e8955a",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = pl.read_parquet(\"stock_basic.parquet\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3a375bc6-dd3a-4f0e-b1ba-a14be3cd263b",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4b7f2bb0-97f7-4124-acb9-a09b194cbcbb",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = d1.with_columns(\n",
    "    ipo_date=pl.col.ipo_date.str.to_date(\"%Y%m%d\"),\n",
    "    issue_date=pl.col.issue_date.str.to_date(\"%Y%m%d\"),\n",
    ")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "199a707e-07bd-4026-936b-611bf2bb78fc",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = d2.with_columns(\n",
    "    list_date=pl.col.list_date.str.to_date(\"%Y%m%d\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a1020451-2b79-4656-b252-d6b3945ed956",
   "metadata": {},
   "outputs": [],
   "source": [
    "config = '{\"version\":\"3.5.1\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"pe\":{\"number_format\":{\"style\":\"currency\",\"currency\":\"USD\"}},\"name\":{\"string_color_mode\":\"series\",\"color\":\"#3d27aa\"},\"amount\":{\"number_format\":{\"style\":\"currency\",\"currency\":\"USD\"}}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[],\"filter\":[],\"expressions\":{},\"columns\":[\"ts_code\",\"sub_code\",\"name\",\"ipo_date\",\"issue_date\",\"amount\",\"market_amount\",\"price\",\"pe\",\"limit_amount\",\"funds\",\"ballot\"],\"aggregates\":{}}'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8f7108a0-1904-49ad-a37d-f3c337a39916",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pathlib import Path"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
